<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp"%>
<html>
<head>
    <meta charset="utf-8" />
    <title>厅干部平时考核管理系统</title>
    <script>
        $(function(){
            initTable();
        });
        var $table = $('#boot_table'),
                $remove = $('#remove'),
                selections = [];

        function initTable() {
            $('#boot_table').bootstrapTable({
                idField:"dbid",
                pagination:'true',
                sidePagination:'server',
                url :'<c:url value="/sys/role/list.json"/>',//考官列表
                height: getHeight(),
                columns: [
                    {
                        title: '序号',
                        field: 'Number',
                        align: 'center',
                        formatter: function (value, row, index) {
                            var page = $('#boot_table').bootstrapTable("getOptions");
                            return ((page.pageNumber-1)*page.pageSize)+index+1;
                        }
                    }, {
                        title: '角色名称',
                        field: 'rname',
                        align: 'center',
                        valign: 'middle'
                    }, {
                        field: 'remark',
                        title: '备注',
                        align: 'center'
                    },{
                        field: 'operate',
                        title: '操作',
                        align: 'center',
                        formatter: function(value, row, index){
                            return   "&nbsp;<a href=\"javascript:uumsRoleEdit("+row.rcode+",'"+row.rname+"');\" title='查看人员'>查看人员</a>&nbsp;"+
                                    "&nbsp;<a href=\"javascript:uumsRoleResource("+row.rcode+",'"+row.rname+"');\" title='查看资源'>查看资源</a>&nbsp;";
                        }
                    }
                ]
            });
        }
        function getHeight() {
            return $(window).height() - $('h1').outerHeight(true)-43;
        }

        function uumsRoleResource(roleId, roleName){
            var title ="查看角色资源" + "【" + roleName + "】";
            var open = layer.open({
                type: 2, //0（信息框，默认）1（页面层）2（iframe层）3（加载层）4（tips层）。
                shift: 1, //动画    0-6     css3动画
                closeBtn: 1, //关闭按钮  0 不显示  style  1和2  标题为 false 2
                btn: ['确定', '取消'],
                btn1: function(index, layero){
                    var newpsw = $(layero).find("iframe")[0].contentWindow;
                    newpsw.saveRoleResource(roleId);
                },
                title: [title, 'background:#5f9ad1;color:#fff;text-align: left;font-size: 18px;'],
                area: ['600px', '460px'], //宽高
                content: "<c:url value='/sys/role/resource/@.html'/>".replace("@",roleId) //iframe层-禁滚动条  $("#photosDemo").html()   'http://www.baidu.com/'
            });
        }
        function uumsRoleEdit(roleId, roleName) {

            var title ="显示人员--【" + roleName + "】";
            var open = layer.open({
                type: 2, //0（信息框，默认）1（页面层）2（iframe层）3（加载层）4（tips层）。
                shift: 1, //动画    0-6     css3动画
                closeBtn: 1, //关闭按钮  0 不显示  style  1和2  标题为 false 2
                btn: ['确定', '取消'],
                btn1: function(index, layero){
                    var newpsw = $(layero).find("iframe")[0].contentWindow;
                    newpsw.saveRoleUsersData();
                },
                title: [title, 'background:#5f9ad1;color:#fff;text-align: left;font-size: 18px;'],
                area: ['887px', '510px'], //宽高
                content: "<c:url value='/sys/role/users/@.html'/>".replace("@",roleId) //iframe层-禁滚动条  $("#photosDemo").html()   'http://www.baidu.com/'
            });
        }
    </script>

</head>

<body>
<div class="njga" style="overflow: hidden;">
    <div class="bmkhcp" style="overflow: hidden;background: #fff">
        <div class="bmkhcp_row">
            <div class="bmkhcp_lf" style="width: 100%;position: relative;">
                <div class="title" style="margin-bottom: 20px;">角色配置</div>
                <table id="boot_table"></table>
            </div>
        </div>
    </div>
</div>
<!--新增周报弹出框-->
<div class="date_pop" id="date_pop">
    <div class="row_pop_row">
        <div class="row_pop_row_lf">
            <div class="row_pop_row_lf_top">
                <input type="text" placeholder="请输入查询关键字" class="inpt" />
            </div>
            <div class="row_pop_row_lf_b">
                <div class="row_text">通知通报</div>
                <div class="row_text">统计分析</div>
                <div class="row_text">部门考核</div>
                <div class="row_text">我的自评</div>
                <div class="row_text">自动签到</div>
                <div class="row_text">通知通报</div>
                <div class="row_text">统计分析</div>
                <div class="row_text">部门考核</div>
                <div class="row_text">我的自评</div>
                <div class="row_text">自动签到</div>
            </div>
        </div>
        <div class="row_pop_row_rt">
            <p>已选资源：<span>3</span>/<span>100</span></p>
            <div class="name_wraper">
                <div class="name">通知通报
                    <div class="del">
                        <img src="<c:url value='/resource/jxkh/images/guanbi.png'/>" />
                    </div>
                </div>
                <div class="name">我的自评
                    <div class="del">
                        <img src="<c:url value='/resource/jxkh/images/guanbi.png'/>" />
                    </div>
                </div>
                <div class="name">部门考核
                    <div class="del">
                        <img src="<c:url value='/resource/jxkh/images/guanbi.png'/>" />
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--弹出框结束-->

<script type="text/javascript">
    $(document).ready(function() {
        //资源弹出框
        $("#ziyuan").on("click", function() {
            var open = layer.open({
                type: 1, //0（信息框，默认）1（页面层）2（iframe层）3（加载层）4（tips层）。
                shift: 1, //动画    0-6     css3动画
                closeBtn: 1, //关闭按钮  0 不显示  style  1和2  标题为 false 2
                btn: ['确定', '取消'],
                title: ['分配资源', 'background:#5f9ad1;color:#fff;text-align: left;font-size: 18px;'],
                area: ['508px', '520px'], //宽高
                content: $("#date_pop") //iframe层-禁滚动条  $("#photosDemo").html()   'http://www.baidu.com/'
            });
        });
        //资源弹出框结束
    })
</script>
</body>

</html>